import { Document, Schema } from 'mongoose'

export interface User extends Document {
  username: string
  password: string
  email: string
  wechatId?: string
  createdAt: Date
  updatedAt: Date
}

export const UserSchema = new Schema({
  username: { type: String, required: true },
  password: { type: String, required: true },
  email: { type: String, required: true },
  wechatId: { type: String },
  createdAt: { type: Date, default: Date.now },
  updatedAt: { type: Date, default: Date.now },
})
